# 
# 
# Author: Guochun Shen
# Data:   2011-12-18
# Project:spatial statistic
# Email:  shenguochun@gmail.com
###############################################################################


test.partial_rthin=function(){
	mydata("phylo_mark_data")
	status=get_marks(data.ppp,"status")
	cond=status=="A" | status=="AB"
    nre=numeric()
	for (i in 1:10){
	   new.data=partial_rthin(data.ppp,0.5,cond)
	   nre[i]=new.data$n
	}
	nre.mean=mean(nre)
	nre.expect=data.ppp$n-sum(!cond)/2
	checkTrue(nre.mean>(nre.expect-data.ppp$n*0.1) &
			nre.mean<(nre.expect+data.ppp$n*0.1)		)
	#browser();
}
